﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CDB.LinqModel.Data;


namespace CDB.LinqModel
{
    public partial class Builder
    {
        #region Variable Declaration
        private IDataRepository _dataObject;
        #endregion

        public Builder(IDataRepository dataObject)
            : this()
        {
            _dataObject = dataObject;
        }
        public void Create()
        {
            _dataObject.CreateBuilder(this);
        }
        public void Update()
        {
            _dataObject.UpdateBuilder(this);
        }
        public void Delete()
        {
            _dataObject.DeleteBuilder(this);
        }
        public void CheckBuilderByUsername()
        {
            _dataObject.CheckBuilderByUsername(this);
        }
        public List<Builder> GetAllBuilders()
        {
            return _dataObject.GetAllBuilders(this);
        }
        public void GetBuilderById()
        {
            _dataObject.GetBuilderById(this);
        }
        //public List<Builder> GetBuildersByCity(int cityId)
        //{
        //    return _dataObject.GetBuildersByCity(cityId);
        //}
        public List<Builder> GetBuildersByLocation(string location)
        {
            return _dataObject.GetBuildersByLocation(location);
        }
    }
}
